﻿using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net.Mail;
using System.Text;

namespace EmailSender
{
    public class Message
    {
        private readonly IDictionary _fields;
        private readonly IDictionary _headers;
        private readonly IDictionary<string, LinkedResource> _linkedResources;

        public Message()
        {
            Format = Format.Text;
            Encoding = Encoding.ASCII;
            _headers = new HybridDictionary();
            _fields = new HybridDictionary();
            Attachments = new MessageAttachmentList();
            _linkedResources = new Dictionary<string, LinkedResource>();
        }

        public Message(string from, string to, string subject, string body)
        {
            Format = Format.Text;
            Encoding = Encoding.ASCII;
            _headers = new HybridDictionary();
            _fields = new HybridDictionary();
            Attachments = new MessageAttachmentList();
            _linkedResources = new Dictionary<string, LinkedResource>();
            To = to;
            From = from;
            Body = body;
            Subject = subject;
        }

        public MessageAttachmentList Attachments { get; set; }

        public string Bcc { get; set; }

        public string Body { get; set; }

        public string Cc { get; set; }

        public Encoding Encoding { get; set; }

        public IDictionary Fields
        {
            get { return _fields; }
        }

        public Format Format { get; set; }

        public string From { get; set; }

        public IDictionary Headers
        {
            get { return _headers; }
        }

        public MessagePriority Priority { get; set; }

        public MailAddress ReplyTo { get; set; }

        public IDictionary<string, LinkedResource> Resources
        {
            get { return _linkedResources; }
        }

        public string Subject { get; set; }

        public string To { get; set; }
    }
}